package lab02.test06;

public class Triangle {
    double firstSide;
    double secondSide;
    double thirdSide;
    double perimeter;
    double area;
    boolean judge;

    void set(double firstSide, double secondSide, double thirdSide) {
        this.firstSide = firstSide;
        this.secondSide = secondSide;
        this.thirdSide = thirdSide;
        if (firstSide + secondSide > thirdSide && firstSide + thirdSide > secondSide && secondSide + thirdSide > firstSide)
            System.out.println(judge = true);
        else System.out.println(judge = false);
    }
    double getFirstSide() {
        return firstSide;
    }

    double getSecondSide() {
        return secondSide;
    }

    double getThirdSide() {
        return thirdSide;
    }

    double Perimeter() {
        perimeter = firstSide + secondSide + thirdSide;
        return perimeter;
    }

    double area() {
        double p;
        p = (firstSide + secondSide + thirdSide) / 2;
        area = Math.sqrt(p * (p - firstSide) * (p - secondSide) * (p - thirdSide));
        return area;
    }
}
